home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Taiji Applet Pack v2.7 / StarsText2 / StarsText2.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-11-06  |  13.5 KB  |  695 lines

  1. import java.applet.Applet;
  2. import java.applet.AudioClip;
  3. import java.awt.BorderLayout;
  4. import java.awt.Color;
  5. import java.awt.Component;
  6. import java.awt.Container;
  7. import java.awt.Cursor;
  8. import java.awt.Font;
  9. import java.awt.FontMetrics;
  10. import java.awt.Graphics;
  11. import java.awt.Image;
  12. import java.awt.MediaTracker;
  13. import java.awt.Scrollbar;
  14. import java.awt.event.AdjustmentEvent;
  15. import java.awt.event.AdjustmentListener;
  16. import java.awt.event.MouseEvent;
  17. import java.awt.event.MouseListener;
  18. import java.net.MalformedURLException;
  19. import java.net.URL;
  20. import java.net.URLEncoder;
  21.  
  22. public class StarsText2 extends Applet implements Runnable, AdjustmentListener, MouseListener {
  23.    private Thread thread;
  24.    private Image backImage;
  25.    private Image buffer;
  26.    // $FF: renamed from: b java.awt.Graphics
  27.    private Graphics field_0;
  28.    private boolean loaded;
  29.    private boolean move = true;
  30.    // $FF: renamed from: on boolean
  31.    private boolean field_1 = true;
  32.    private boolean firstime = true;
  33.    private boolean isBackImage = false;
  34.    private boolean paintable = false;
  35.    private boolean zoomable = true;
  36.    private int text_height;
  37.    private int current_height;
  38.    private int height_step;
  39.    private int height_step2;
  40.    private int he_init;
  41.    private int n_pas;
  42.    private int letter_width;
  43.    private int letter_width_100;
  44.    private int letter_ascent;
  45.    private int letter_ascent_100;
  46.    // $FF: renamed from: wi int
  47.    private int field_2;
  48.    // $FF: renamed from: he int
  49.    private int field_3;
  50.    private int wiBack;
  51.    private int heBack;
  52.    private int pause;
  53.    private int number;
  54.    // $FF: renamed from: X int[]
  55.    private int[] field_4;
  56.    // $FF: renamed from: Y int[]
  57.    private int[] field_5;
  58.    private int[] step;
  59.    private int decx;
  60.    private int decy;
  61.    // $FF: renamed from: x2 int
  62.    private int field_6;
  63.    // $FF: renamed from: y2 int
  64.    private int field_7;
  65.    // $FF: renamed from: x int
  66.    private int field_8;
  67.    // $FF: renamed from: y int
  68.    private int field_9;
  69.    private int x_init;
  70.    private int y_init;
  71.    private int n_p;
  72.    private int decX;
  73.    // $FF: renamed from: l int
  74.    private int field_10;
  75.    private int[] index;
  76.    private int n_text;
  77.    private int step_mean;
  78.    private String letter;
  79.    private String backImageName;
  80.    private String text;
  81.    private String big_text;
  82.    private Color starColor;
  83.    private Color backColor;
  84.    // $FF: renamed from: fm java.awt.FontMetrics
  85.    private FontMetrics field_11;
  86.    private Scrollbar scroll;
  87.    private int pause_init;
  88.    private boolean isScrollbar;
  89.    private String statusBarText;
  90.    private AudioClip sound;
  91.    private AudioClip clicSound;
  92.    private AudioClip enterSound;
  93.    private boolean loopSound;
  94.    private String link;
  95.    private FontMetrics fm2;
  96.    private String enterText;
  97.    private boolean isEnterTextEnabled;
  98.    private int wiEnterText;
  99.    private int enterTextHeight;
  100.    private Color enterTextColor;
  101.    private Font bufferFont;
  102.    private Font textFont;
  103.  
  104.    public String getAppletInfo() {
  105.       return "Name: StarsText2\r\nAuthor: Taiji Software\r\n";
  106.    }
  107.  
  108.    public StarsText2() {
  109.       this.move = true;
  110.       this.pause = 20;
  111.       this.number = 100;
  112.       this.text_height = 10;
  113.       this.height_step = 2;
  114.       this.height_step2 = 2;
  115.       ((Component)this).addMouseListener(this);
  116.    }
  117.  
  118.    public void register() {
  119.       try {
  120.          URL u = new URL("http://www.taijisoftware.com");
  121.          ((Applet)this).getAppletContext().showDocument(u, "_blank");
  122.       } catch (Exception e) {
  123.          System.out.println(e);
  124.          this.stop();
  125.       }
  126.    }
  127.  
  128.    public void init() {
  129.       String codeBase = null;
  130.  
  131.       try {
  132.          codeBase = (new URL(((Applet)this).getCodeBase().toString())).getHost();
  133.          System.out.println("Copyright 1999, 2001 Taiji Software(tm)\nYour domain name is : " + codeBase);
  134.          codeBase = codeBase.toUpperCase();
  135.       } catch (Exception var9) {
  136.       }
  137.  
  138.       if (!((Applet)this).getCodeBase().toString().toUpperCase().startsWith("FILE") || ((Applet)this).getParameter("debug") != null) {
  139.          String regCode = ((Applet)this).getParameter("registration_code");
  140.          if (regCode == null) {
  141.             regCode = ((Applet)this).getParameter("reg_domain");
  142.             if (regCode == null) {
  143.                this.register();
  144.             } else {
  145.                if (regCode.length() == codeBase.length() + 4 && !codeBase.startsWith("WWW.")) {
  146.                   codeBase = "WWW." + codeBase;
  147.                } else if (regCode.length() == codeBase.length() - 4 && codeBase.startsWith("WWW.")) {
  148.                   codeBase = codeBase.substring(4);
  149.                }
  150.  
  151.                char[] chars = new char[codeBase.length()];
  152.                codeBase.getChars(0, codeBase.length(), chars, 0);
  153.                String key = new String("haricot");
  154.                char[] chars2 = new char[key.length()];
  155.                key.getChars(0, key.length(), chars2, 0);
  156.  
  157.                for(int i = 0; i < codeBase.length(); ++i) {
  158.                   int j;
  159.                   if (i >= key.length()) {
  160.                      j = i - key.length() * (i / key.length());
  161.                   } else {
  162.                      j = i;
  163.                   }
  164.  
  165.                   chars[i] += chars2[j];
  166.                   chars[i] = (char)(chars[i] - chars[i] / 26 * 26 + 97);
  167.                }
  168.  
  169.                String res = new String(chars);
  170.                if (!res.equalsIgnoreCase(regCode)) {
  171.                   this.register();
  172.                }
  173.             }
  174.          } else if (!regCode.equals("settevercsedegnamiaj") && !regCode.equals("8078")) {
  175.             this.register();
  176.          }
  177.       }
  178.  
  179.       this.getParameters();
  180.       this.scroll = new Scrollbar(1, 30, 1, 0, 60);
  181.       this.scroll.addAdjustmentListener(this);
  182.       if (this.isScrollbar) {
  183.          ((Container)this).setLayout(new BorderLayout());
  184.          ((Container)this).add("East", this.scroll);
  185.       }
  186.  
  187.       if (this.sound != null) {
  188.          if (this.loopSound) {
  189.             this.sound.loop();
  190.             return;
  191.          }
  192.  
  193.          this.sound.play();
  194.       }
  195.  
  196.    }
  197.  
  198.    public void getParameters() {
  199.       this.field_2 = ((Component)this).getSize().width;
  200.       if (this.isScrollbar) {
  201.          this.field_2 -= this.scroll.getSize().width;
  202.       }
  203.  
  204.       this.field_3 = ((Component)this).getSize().height;
  205.       String s = ((Applet)this).getParameter("pause");
  206.       if (s != null) {
  207.          this.pause = Integer.parseInt(s);
  208.       }
  209.  
  210.       this.pause_init = this.pause;
  211.       s = ((Applet)this).getParameter("number");
  212.       if (s != null) {
  213.          this.number = Integer.parseInt(s);
  214.       }
  215.  
  216.       this.big_text = ((Applet)this).getParameter("text");
  217.       s = ((Applet)this).getParameter("text_height");
  218.       if (s != null) {
  219.          this.text_height = Integer.parseInt(s);
  220.       }
  221.  
  222.       s = ((Applet)this).getParameter("step_mean");
  223.       if (s != null) {
  224.          this.step_mean = Integer.parseInt(s);
  225.       } else {
  226.          this.step_mean = this.field_2 / 10;
  227.       }
  228.  
  229.       s = ((Applet)this).getParameter("height_step");
  230.       if (s != null) {
  231.          this.height_step = Integer.parseInt(s);
  232.       }
  233.  
  234.       s = ((Applet)this).getParameter("height_step2");
  235.       if (s != null) {
  236.          this.height_step2 = Integer.parseInt(s);
  237.       }
  238.  
  239.       s = ((Applet)this).getParameter("height_init");
  240.       if (s != null) {
  241.          this.he_init = Integer.parseInt(s);
  242.       } else {
  243.          this.he_init = this.field_3;
  244.       }
  245.  
  246.       s = ((Applet)this).getParameter("scrollbar");
  247.       if (s != null) {
  248.          this.isScrollbar = new Boolean(s);
  249.       } else {
  250.          this.isScrollbar = false;
  251.       }
  252.  
  253.       this.starColor = this.getColor("star_color");
  254.       if (this.starColor == null) {
  255.          this.starColor = Color.white;
  256.       }
  257.  
  258.       this.backColor = this.getColor("background_color");
  259.       if (this.backColor == null) {
  260.          this.backColor = Color.black;
  261.       }
  262.  
  263.       ((Component)this).setBackground(this.backColor);
  264.       this.backImageName = ((Applet)this).getParameter("background_image");
  265.       if (this.backImageName != null) {
  266.          this.isBackImage = true;
  267.       }
  268.  
  269.       this.statusBarText = ((Applet)this).getParameter("status_bar_text");
  270.       s = ((Applet)this).getParameter("sound_name");
  271.       if (s != null) {
  272.          this.sound = ((Applet)this).getAudioClip(((Applet)this).getCodeBase(), s);
  273.       }
  274.  
  275.       s = ((Applet)this).getParameter("loop_sound");
  276.       if (s != null) {
  277.          if (s.equals("yes")) {
  278.             this.loopSound = true;
  279.          } else {
  280.             this.loopSound = false;
  281.          }
  282.       }
  283.  
  284.       s = ((Applet)this).getParameter("clic_sound_name");
  285.       if (s != null) {
  286.          this.clicSound = ((Applet)this).getAudioClip(((Applet)this).getCodeBase(), s);
  287.       }
  288.  
  289.       s = ((Applet)this).getParameter("enter_sound_name");
  290.       if (s != null) {
  291.          this.enterSound = ((Applet)this).getAudioClip(((Applet)this).getCodeBase(), s);
  292.       }
  293.  
  294.       this.link = ((Applet)this).getParameter("link");
  295.       this.enterText = ((Applet)this).getParameter("enter_text");
  296.       s = ((Applet)this).getParameter("enter_text_height");
  297.       if (s != null) {
  298.          this.enterTextHeight = Integer.parseInt(s);
  299.       }
  300.  
  301.       this.enterTextColor = this.getColor("enter_text_color");
  302.       if (this.enterTextColor == null) {
  303.          this.enterTextColor = Color.white;
  304.       }
  305.  
  306.    }
  307.  
  308.    public Color getColor(String param) {
  309.       String s = ((Applet)this).getParameter(param);
  310.       if (s != null) {
  311.          if (s.substring(0, 1).equals("#")) {
  312.             s = s.substring(1);
  313.             int i = Integer.parseInt(s, 16);
  314.             return new Color(i);
  315.          } else {
  316.             return null;
  317.          }
  318.       } else {
  319.          return null;
  320.       }
  321.    }
  322.  
  323.    public void adjustmentValueChanged(AdjustmentEvent e) {
  324.       int v = this.scroll.getValue() - 30;
  325.       float f = (float)v;
  326.       if (f < 0.0F) {
  327.          f = 1.0F / f;
  328.       }
  329.  
  330.       this.pause = (int)((float)this.pause_init * f);
  331.       if (this.pause < 5) {
  332.          this.pause = 5;
  333.       }
  334.  
  335.    }
  336.  
  337.    public final void refonte(int h) {
  338.       this.field_0.setFont(new Font("TimesRoman", 1, h));
  339.       this.field_11 = this.field_0.getFontMetrics();
  340.    }
  341.  
  342.    public final void nextLetter() {
  343.       this.letter = this.text.substring(this.field_10, this.field_10 + 1);
  344.       this.refonte(this.text_height);
  345.       this.letter_width_100 = this.field_11.stringWidth(this.letter);
  346.       this.letter_ascent_100 = this.field_11.getAscent();
  347.       this.current_height = this.he_init;
  348.       this.refonte(this.current_height);
  349.       this.letter_width = this.field_11.stringWidth(this.letter);
  350.       this.letter_ascent = this.field_11.getMaxAscent();
  351.       this.field_6 = (this.letter_width_100 - this.letter_width) / 2;
  352.       this.field_7 = (this.text_height - this.current_height) / 2 + this.letter_ascent - this.text_height;
  353.       this.x_init = (this.field_2 - this.field_11.stringWidth(this.letter)) / 2 - this.field_6;
  354.       this.y_init = (this.field_3 + this.field_11.getMaxAscent() - this.field_11.getMaxDescent()) / 2 - this.field_7;
  355.       this.n_p = 0;
  356.    }
  357.  
  358.    public final void nextText() {
  359.       ++this.n_text;
  360.       if (this.n_text > this.index.length) {
  361.          this.text = this.big_text.substring(0, this.index[0]);
  362.          this.n_text = 0;
  363.       } else if (this.n_text == this.index.length) {
  364.          this.text = this.big_text.substring(this.index[this.n_text - 1] + 1);
  365.       } else {
  366.          this.text = this.big_text.substring(this.index[this.n_text - 1] + 1, this.index[this.n_text]);
  367.       }
  368.  
  369.       this.refonte(this.text_height);
  370.       this.decx = (this.field_2 - this.field_11.stringWidth(this.text)) / 2;
  371.       this.decy = (this.field_3 + this.field_11.getMaxAscent() - this.field_11.getMaxDescent()) / 2;
  372.       this.field_10 = 0;
  373.       this.decX = 0;
  374.    }
  375.  
  376.    public final void paint(Graphics g) {
  377.       if (this.paintable) {
  378.          this.field_0.clearRect(0, 0, this.field_2, this.field_3);
  379.          if (this.isBackImage & this.loaded) {
  380.             this.field_0.drawImage(this.backImage, (this.field_2 - this.wiBack) / 2, (this.field_3 - this.heBack) / 2, this);
  381.          }
  382.  
  383.          if (this.zoomable) {
  384.             this.refonte(this.current_height);
  385.             this.letter_width = this.field_11.stringWidth(this.letter);
  386.             this.letter_ascent = this.field_11.getMaxAscent();
  387.             this.n_pas = (this.he_init - this.text_height) / this.height_step;
  388.             if (this.n_p > this.n_pas) {
  389.                this.n_p = this.n_pas;
  390.             }
  391.  
  392.             this.field_8 = this.x_init - this.n_p * (this.x_init - (this.decX + this.decx)) / this.n_pas;
  393.             this.field_9 = this.y_init - this.n_p * (this.y_init - this.decy) / this.n_pas;
  394.             this.field_6 = (this.letter_width_100 - this.letter_width) / 2;
  395.             this.field_7 = (this.text_height - this.current_height) / 2 + this.letter_ascent - this.text_height;
  396.             this.field_0.drawString(this.letter, this.field_8 + this.field_6, this.field_9 + this.field_7);
  397.          }
  398.  
  399.          if (!this.zoomable) {
  400.             this.refonte(this.current_height);
  401.             this.letter_width = this.field_11.stringWidth(this.text);
  402.             this.letter_ascent = this.field_11.getMaxAscent();
  403.             this.field_8 = (this.letter_width_100 - this.letter_width) / 2;
  404.             this.field_9 = (this.text_height - this.current_height) / 2 + this.letter_ascent - this.text_height;
  405.             this.field_0.drawString(this.text.substring(0, this.field_10), this.decx + this.field_8, this.decy + this.field_9);
  406.             this.current_height -= this.height_step2;
  407.             if (this.current_height <= this.height_step2) {
  408.                if (this.index != null) {
  409.                   this.nextText();
  410.                }
  411.  
  412.                this.refonte(this.text_height);
  413.                this.field_10 = 0;
  414.                this.decX = 0;
  415.                this.nextLetter();
  416.                this.zoomable = true;
  417.             }
  418.          }
  419.  
  420.          if (this.field_10 != 0 & this.zoomable) {
  421.             this.refonte(this.text_height);
  422.             this.field_0.drawString(this.text.substring(0, this.field_10), this.decx, this.decy);
  423.          }
  424.  
  425.          if (this.zoomable) {
  426.             this.current_height -= this.height_step;
  427.             ++this.n_p;
  428.          }
  429.  
  430.          if (this.current_height <= this.text_height & this.zoomable) {
  431.             if (this.field_10 == this.text.length() - 1) {
  432.                this.zoomable = false;
  433.                ++this.field_10;
  434.                this.current_height = this.text_height;
  435.                this.refonte(this.text_height);
  436.                this.letter_width_100 = this.field_11.stringWidth(this.text);
  437.                this.letter_ascent_100 = this.field_11.getAscent();
  438.             } else {
  439.                this.decX += this.letter_width_100;
  440.                ++this.field_10;
  441.                this.nextLetter();
  442.             }
  443.          }
  444.  
  445.          for(int i = 0; i < this.number; ++i) {
  446.             this.field_0.drawRect(this.field_4[i], this.field_5[i], 1, 1);
  447.          }
  448.  
  449.          if (this.isEnterTextEnabled) {
  450.             this.bufferFont = this.field_0.getFont();
  451.             this.field_0.setColor(this.enterTextColor);
  452.             this.field_0.setFont(this.textFont);
  453.             this.field_0.drawString(this.enterText, (this.field_2 - this.wiEnterText) / 2, this.field_3 / 2);
  454.             this.field_0.setColor(this.starColor);
  455.             this.field_0.setFont(this.bufferFont);
  456.          }
  457.  
  458.          g.drawImage(this.buffer, 0, 0, this);
  459.       }
  460.  
  461.    }
  462.  
  463.    public final void update(Graphics g) {
  464.       this.paint(g);
  465.    }
  466.  
  467.    public void start() {
  468.       if (this.thread == null) {
  469.          this.move = true;
  470.          this.thread = new Thread(this);
  471.          this.thread.start();
  472.       }
  473.  
  474.    }
  475.  
  476.    public void stop() {
  477.       if (this.thread != null) {
  478.          this.move = false;
  479.          this.thread = null;
  480.       }
  481.  
  482.       if (this.sound != null) {
  483.          this.sound.stop();
  484.       }
  485.  
  486.    }
  487.  
  488.    public void run() {
  489.       if (this.firstime) {
  490.          if (this.isBackImage) {
  491.             MediaTracker tracker = new MediaTracker(this);
  492.             this.backImage = ((Applet)this).getImage(((Applet)this).getCodeBase(), this.backImageName);
  493.             tracker.addImage(this.backImage, 0);
  494.  
  495.             try {
  496.                tracker.waitForAll();
  497.                this.loaded = !tracker.isErrorAny();
  498.             } catch (InterruptedException var6) {
  499.                this.stop();
  500.             }
  501.  
  502.             if (!this.loaded) {
  503.                this.stop();
  504.                return;
  505.             }
  506.          }
  507.  
  508.          if (this.isBackImage) {
  509.             this.wiBack = this.backImage.getWidth(this);
  510.             this.heBack = this.backImage.getHeight(this);
  511.          }
  512.  
  513.          this.buffer = ((Component)this).createImage(this.field_2, this.field_3);
  514.          this.field_0 = this.buffer.getGraphics();
  515.          String fontName = ((Applet)this).getParameter("enter_text_font");
  516.          if (fontName == null) {
  517.             fontName = "TimesRoman";
  518.          }
  519.  
  520.          int style = 1;
  521.          String s = ((Applet)this).getParameter("enter_text_style");
  522.          if (s != null) {
  523.             if (s.equals("bold")) {
  524.                style = 1;
  525.             } else if (s.equals("italic")) {
  526.                style = 2;
  527.             } else if (s.equals("bold_italic")) {
  528.                style = 3;
  529.             } else {
  530.                style = 0;
  531.             }
  532.          }
  533.  
  534.          this.textFont = new Font(fontName, style, this.enterTextHeight);
  535.          this.field_0.setFont(new Font("TimesRoman", 1, this.enterTextHeight));
  536.          this.fm2 = this.field_0.getFontMetrics();
  537.          if (this.enterText != null) {
  538.             this.wiEnterText = this.fm2.stringWidth(this.enterText);
  539.          }
  540.  
  541.          this.field_0.setColor(this.starColor);
  542.          this.paintable = true;
  543.          this.firstime = false;
  544.       }
  545.  
  546.       this.field_4 = new int[this.number];
  547.       this.field_5 = new int[this.number];
  548.       this.step = new int[this.number];
  549.  
  550.       for(int i = 0; i < this.number; ++i) {
  551.          this.field_4[i] = (int)((double)this.field_2 * Math.random());
  552.          this.field_5[i] = (int)((double)this.field_3 * Math.random());
  553.          this.step[i] = (int)((double)this.step_mean * Math.random()) + 1;
  554.       }
  555.  
  556.       int c = 0;
  557.  
  558.       int m;
  559.       for(m = 0; (c = this.big_text.indexOf("#", c)) != -1; ++m) {
  560.          ++c;
  561.       }
  562.  
  563.       if (m != 0) {
  564.          this.index = new int[m];
  565.  
  566.          for(int var14 = 0; (c = this.big_text.indexOf("#", c)) != -1; ++var14) {
  567.             this.index[var14] = c++;
  568.          }
  569.  
  570.          this.text = this.big_text.substring(0, this.index[0]);
  571.          this.n_text = 0;
  572.       } else {
  573.          this.text = this.big_text;
  574.       }
  575.  
  576.       this.refonte(this.text_height);
  577.       this.decx = (this.field_2 - this.field_11.stringWidth(this.text)) / 2;
  578.       this.decy = (this.field_3 + this.field_11.getMaxAscent() - this.field_11.getMaxDescent()) / 2;
  579.       this.field_10 = 0;
  580.       this.decX = 0;
  581.       this.nextLetter();
  582.  
  583.       while(this.move) {
  584.          while(this.field_1) {
  585.             for(int i = 0; i < this.number; ++i) {
  586.                int[] var10000 = this.field_4;
  587.                var10000[i] += this.step[i];
  588.                if (this.field_4[i] > this.field_2) {
  589.                   this.field_4[i] = 0;
  590.                }
  591.             }
  592.  
  593.             ((Component)this).repaint();
  594.  
  595.             try {
  596.                Thread.sleep((long)this.pause);
  597.             } catch (InterruptedException var7) {
  598.                this.stop();
  599.             }
  600.  
  601.             if (!this.field_1) {
  602.             }
  603.          }
  604.  
  605.          try {
  606.             Thread.sleep(100L);
  607.          } catch (InterruptedException var5) {
  608.             this.stop();
  609.          }
  610.       }
  611.  
  612.    }
  613.  
  614.    public URL giveURL(String url) {
  615.       try {
  616.          if (url.toUpperCase().startsWith("HTTP")) {
  617.             return new URL(url);
  618.          } else if (url.toUpperCase().startsWith("FTP")) {
  619.             int p = url.indexOf(":");
  620.             int p2 = url.indexOf(":", p + 1);
  621.             if (p2 != -1) {
  622.                url = url.substring(0, p + 3) + URLEncoder.encode(url.substring(p + 3, url.length()));
  623.             }
  624.  
  625.             p = url.indexOf("%40");
  626.             if (p != -1) {
  627.                url = url.substring(0, p) + "@" + url.substring(p + 3, url.length());
  628.             }
  629.  
  630.             return new URL(url);
  631.          } else {
  632.             return new URL(((Applet)this).getCodeBase(), url);
  633.          }
  634.       } catch (MalformedURLException e) {
  635.          System.out.println(e);
  636.          return null;
  637.       }
  638.    }
  639.  
  640.    public void mouseClicked(MouseEvent e) {
  641.    }
  642.  
  643.    public void mouseEntered(MouseEvent e) {
  644.       if (this.enterText != null) {
  645.          this.isEnterTextEnabled = true;
  646.          ((Component)this).repaint();
  647.       }
  648.  
  649.       if (this.statusBarText != null) {
  650.          ((Applet)this).showStatus(this.statusBarText);
  651.       }
  652.  
  653.       if (this.enterSound != null) {
  654.          this.enterSound.play();
  655.       }
  656.  
  657.       if (this.link != null) {
  658.          ((Component)this).setCursor(new Cursor(12));
  659.       }
  660.  
  661.    }
  662.  
  663.    public void mouseExited(MouseEvent e) {
  664.       if (this.isEnterTextEnabled) {
  665.          this.isEnterTextEnabled = false;
  666.          ((Component)this).repaint();
  667.       }
  668.  
  669.       if (this.link != null) {
  670.          ((Component)this).setCursor(new Cursor(0));
  671.       }
  672.  
  673.    }
  674.  
  675.    public void mousePressed(MouseEvent e) {
  676.       if (this.clicSound != null) {
  677.          this.clicSound.play();
  678.       }
  679.  
  680.       if (this.link != null) {
  681.          String target = ((Applet)this).getParameter("target");
  682.          if (target == null) {
  683.             target = "_blank";
  684.          }
  685.  
  686.          URL u = this.giveURL(this.link);
  687.          ((Applet)this).getAppletContext().showDocument(u, target);
  688.       }
  689.  
  690.    }
  691.  
  692.    public void mouseReleased(MouseEvent e) {
  693.    }
  694. }
  695.